<?php
  $dimension = getimagesize('uploads/' . $results['file_name']);
  $file_dimension =  $dimension[0] . ' x ' . $dimension[1];
?>
<div class="col-sm-7">
  <img id="preview" src="<?=image(site_url('uploads/' . $results['file_name']),'small')?>">
  
  <ul class="attcahment-info">
    <li><strong>Nama berkas:</strong> <?=$results['file_name']?></li>
    <li><strong>Type berkas:</strong> <?=$results['file_type']?></li>
    <li><strong>Diunggah pada:</strong> <?=id_date($results['datetime'],'short').' '.jam($results['datetime'])?></li>
    <li><strong>Ukuran berkas:</strong> <?=get_filesize('./uploads/' . $results['file_name']);?></li>
    <li><strong>Dimensi:</strong> <?=$file_dimension?></li>
    <li><strong>Diunggah oleh:</strong> <?=$results['uploader']?></li>
  </ul>

</div>

<div class="col-sm-5">
  <span id="berhasil" style="display:none;position:absolute;right:20px;top:-5px;color:#ccc;font-size:13px;"><i class="fa fa-check-circle"></i> Berhasil disimpan</span>
  <span id="gagal" style="display:none;position:absolute;right:20px;top:-5px;color:#fc8d8d;font-size:13px;"><i class="fa fa-times-circle"></i> Gagal menyimpan</span>
  <span id="proses" style="display:none;position:absolute;right:20px;top:-5px;color:#ccc;font-size:13px;"><i class="fa fa-circle-o-notch fa-spin"></i> Menyimpan...</span>
  <?php echo form_open_multipart('media/update', array('class' => 'form-horizontal', 'id' => 'update'));?>
    <input type="hidden" value="<?=$results['id_media']?>" name="id_media" id="id_media">
    <div class="form-group" style="margin-right:0px;">
      <label for="file_url">URL</label>
      <input type="text" value="<?=base_url('uploads/' . $results['file_name'])?>" name="file_url" id="file_url" class="form-control input-sm" disabled>
    </div>
    <div class="form-group" style="margin-right:0px;">
      <label for="title">Judul</label>
      <input type="text" value="<?=$results['title']?>" name="title" id="title" class="form-control input-sm">
    </div>
    <div class="form-group" style="margin-right:0px;">
      <label for="caption">Keterangan</label>
      <input type="text" value="<?=$results['caption']?>" name="caption" id="caption" class="form-control input-sm">
    </div>
    <div class="form-group" style="margin-right:0px;">
      <label for="alt_text">Teks Alternatif</label>
      <input type="text" value="<?=$results['alt_text']?>" name="alt_text" id="alt_text" class="form-control input-sm">
    </div>
    <div class="form-group" style="margin-right:0px;">
      <label for="desc">Deskripsi</label>
      <textarea name="desc" id="desc" class="form-control"><?=$results['desc']?></textarea>
    </div>
  <?php echo form_close();?>
  <span style="position:absolute;right:20px;bottom:-35px;color:#fc8d8d;font-size:13px;"><i class="fa fa-times-circle"></i> Hapus lampiran ini</span>
</div>